﻿@model Example6.MvcWebApp.Sharding.Models.HybridShardingTenantDto

@{
    ViewData["Title"] = "Create";
}

<h1>Create Tenant</h1>

<hr />
<div class="row">
    <div class="col-md-8">
        <form asp-action="Create">
            <div asp-validation-summary="ModelOnly" class="text-danger"></div>

            <div class="form-group">
                <label asp-for="TenantName" class="control-label"></label>
                <input asp-for="TenantName" class="form-control" />
                <span asp-validation-for="TenantName" class="text-danger"></span>
            </div>
            <div class="form-group row">
                @Html.LabelFor(model => model.ShardingName, new { @class = "col-sm-3 col-form-label" })
                <div class="col-sm-9">
                    @Html.DropDownListFor(m => m.ShardingName, 
                        new SelectList(Model.AllShardingEntries))
                </div>
            </div>
            <div class="form-group">
                <label asp-for="HasOwnDb" class="control-label"></label>
                @Html.CheckBoxFor(model => model.HasOwnDb)
                <span asp-validation-for="HasOwnDb" class="text-danger"></span>
            </div>
            <div class="form-group">
                <input type="submit" value="Create" class="btn btn-primary" />
            </div>
        </form>
    </div>
</div>

<div>
    <a asp-action="Index">Back to List</a>
</div>

@section Scripts {
    @{await Html.RenderPartialAsync("_ValidationScriptsPartial");}
}
